package com.pet.system.util;
import java.util.List;
import com.pet.server.po.CateBrand;
import net.sf.json.JSONObject;

public class JsonUtil {
	

	public static JSONObject createBrandReg(List<CateBrand> list){
		StringBuffer menuReg= new StringBuffer("(-1|");
		boolean b = true;
		for(CateBrand cb:list){
			if(b){
				menuReg.append(cb.getBrand());
				b=false;
			}else{
				menuReg.append("|"+cb.getBrand());
			}
		}
		menuReg.append(")");
		JSONObject obj = new JSONObject();
		obj.element("regexp", menuReg.toString());
		return obj;
	}
}
